// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.util.set;

import zombie.util.AbstractIntCollection;
import zombie.util.IntIterator;
import zombie.util.hash.DefaultIntHashFunction;

public abstract class AbstractIntSet extends AbstractIntCollection implements IntSet {
    protected AbstractIntSet() {
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof IntSet intSet)) {
            return false;
        } else {
            return intSet.size() != this.size() ? false : this.containsAll(intSet);
        }
    }

    @Override
    public int hashCode() {
        int _int = 0;
        IntIterator intIterator = this.iterator();

        while (intIterator.hasNext()) {
            _int += DefaultIntHashFunction.INSTANCE.hash(intIterator.next());
        }

        return _int;
    }
}
